﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<META HTTP-EQUIV="Refresh" content="5;URL=warnReportAction!disasterWarning.action?listLength=${listLength }&tempString=${tempString}" >
		<c:if test="${not empty warnSoundName}">
			<bgsound
				src="<%=basePath%>/resources/disasterUpload/${warnSoundName}"
				loop="-1" id="music">
		</c:if>
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>/login/css/style.css" />
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>/login/css/theme1.css" />
		<style type="text/css">
#search_bar2 td {
	border: none;
}

#box td {
	height: 28px;
}

th {
	color: #375B91;
}

table {
	width: 910px;
}
</style>
		<script type="text/javascript"
			src="<%=basePath%>/login/scripts/calendar.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>/login/scripts/jquery-1.3.2.min.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>/login/scripts/jquery.quickpaginate.js"></script>
		<script type="text/javascript">
	$(function() {
		$("#dataTable tbody tr").quickpaginate({
			perpage : 10,
			pager : $("#temp")
		});
		if (!"${wind}") {
			$(".wind").hide();
		}
		if (!"${rain}") {
			$(".rain").hide();
		}
	});
	function order(fieldname) {
		$("#order").val(fieldname);
		$("form:first").submit();
	}
	function generateWord() {
		window.location.href = "warnReportAction!generateWord.action";
	}
	function uploadWindow() {
		var message = "Lotus邮件发送";
		var win = window.showModalDialog("login/lotusSend.jsp?rand="
				+ Math.random(), message,
				"dialogWidth=325px;dialogHeight=150px;center=yes;status=no");
	}
</script>
	</head>
	<body>
		<div name="music_block"></div>
		<div id="content2">
			<div id="box2">
				<div>
					<h3>
						当前位置&nbsp;:&nbsp;自动站数据监测&nbsp;>>&nbsp;风雨监测预警
					</h3>
				</div>
				<div id="search_bar2">
					<form action="warnReportAction!disasterWarning.action"
						method="post" id="warnForm">
						<table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td>
									日期:
								</td>
								<td>
									<input name="date" onfocus="calendar()" value="${date}" />
								</td>
								<td>
									时间:
								</td>
								<td>
									<s:select name="hour" list="hourMap" theme="simple"></s:select>
									&nbsp;&nbsp; 分:
									<s:select name="minute"
										list="#{'0':'0分','5':'5分','10':'10分','15':'15分','20':'20分','25':'25分','30':'30分','35':'35分','40':'40分','45':'45分','50':'50分','55':'55分'}"
										theme="simple"></s:select>
								</td>
								<td colspan="2">
									<input type="button" value="上一条记录"
										onclick="javascript:location.href='warnReportAction!reportWarnPrev.action?date=${date }&hour=${hour}&minute=${minute}&warnSet.hourrf=${warnSet.hourrf}&warnSet.threehourrf=${warnSet.threehourrf}&warnSet.twentyfourhourrf=${warnSet.twentyfourhourrf}&warnSet.wd10df=${warnSet.wd10df}&warnSet.wd10maxdf=${warnSet.wd10maxdf}&warnSet.wd3smaxdf=${warnSet.wd3smaxdf}&warnSet.wf10daymax=${warnSet.wf10daymax}&warnSet.wf3daymax=${warnSet.wf3daymax}'" />
									<input type="button" value="下一条记录"
										onclick="javascript:location.href='warnReportAction!reportWarnNext.action?date=${date }&hour=${hour}&minute=${minute}&warnSet.hourrf=${warnSet.hourrf}&warnSet.threehourrf=${warnSet.threehourrf}&warnSet.twentyfourhourrf=${warnSet.twentyfourhourrf}&warnSet.wd10df=${warnSet.wd10df}&warnSet.wd10maxdf=${warnSet.wd10maxdf}&warnSet.wd3smaxdf=${warnSet.wd3smaxdf}&warnSet.wf10daymax=${warnSet.wf10daymax}&warnSet.wf3daymax=${warnSet.wf3daymax}'" />
								</td>
							</tr>
							<tr>
								<td>
									<s:checkbox name="rain" theme="simple"></s:checkbox>
									雨量:
								</td>
								<td colspan="5">
									&nbsp;&nbsp;1小时雨量大于:
									<s:textfield name="warnSet.hourrf" theme="simple" size="1" />
									&nbsp;&nbsp;3小时雨量大于:
									<s:textfield name="warnSet.threehourrf" theme="simple" size="1" />
									&nbsp;&nbsp;24小时雨量大于:
									<s:textfield name="warnSet.twentyfourhourrf" theme="simple"
										size="1" />
								</td>
							</tr>
							<tr>
								<td>
									<s:checkbox name="wind" theme="simple"></s:checkbox>
									风速:
								</td>
								<td colspan="5">
									&nbsp;&nbsp;正点十分钟风速大于:
									<s:textfield name="warnSet.wd10df" theme="simple" size="1" />
									&nbsp;&nbsp;时最大风速大于:
									<s:textfield name="warnSet.wd10maxdf" theme="simple" size="1" />
									&nbsp;&nbsp;时极大风速大于:
									<s:textfield name="warnSet.wd3smaxdf" theme="simple" size="1" />
									&nbsp;&nbsp;日最大风速大于:
									<s:textfield name="warnSet.wf10daymax" theme="simple" size="1" />
									&nbsp;&nbsp;日极大风速大于:
									<s:textfield name="warnSet.wf3daymax" theme="simple" size="1" />
								</td>
							</tr>
							<tr>
								<td colspan="6" align="left">
									<input id="order" name="warnSet.orderbyField" type="hidden" />
									<input id="order" name="warnSet.order"
										value="${warnSet.order }" type="hidden" />
									<input type="hidden" name="listLength" value="${listLength }"/>
									<input type="hidden" name="tempString" value="${tempString }"/>
									<input type="submit" value="查 询" style="width: 120px;" />
									<c:if test="${admin.role==1}">
										<input type="button" value="生成灾情报文"
											onclick="javascript:generateWord();" />
										<input type="button" value="发送灾情报文" onclick="uploadWindow();" />
									</c:if>
									<input type="button" value="播放报警"
										onclick="music.src='<%=basePath%>/resources/disasterUpload/${warnSoundName}'" />
									<input type="button" value="停止报警" onclick="music.src=''" />
								</td>
							</tr>
						</table>
					</form>
				</div>
				<div>
				</div>
				<table id="dataTable">
					<thead>
						<tr>
							<th colspan="2">
								自动站点
							</th>
							<th colspan="3" class="rain">
								雨量
							</th>
							<th colspan="14" class="wind">
								风速
							</th>
						</tr>
						<tr>
							<th rowspan="2">
								代号
							</th>
							<th rowspan="2">
								站名
							</th>
							<th rowspan="2" class="rain">
								<a href="javascript:order('hourrf')" class="order">一小时雨量</a>
							</th>
							<th rowspan="2" class="rain">
								<a href="javascript:order('threehourrf')" class="order">三小时雨量</a>
							</th>
							<th rowspan="2" class="rain">
								<a href="javascript:order('twentyfourhourrf')" class="order">二十四小时雨量</a>
							</th>
							<th colspan="2" class="wind">
								正点十分钟风速
							</th>
							<th colspan="3" class="wind">
								时最大风速
							</th>
							<th colspan="3" class="wind">
								时极大风速
							</th>
							<th colspan="3" class="wind">
								日最大风速
							</th>
							<th colspan="3" class="wind">
								日极大风速
							</th>
						</tr>
						<tr>
							<th class="wind">
								风向
							</th>
							<th class="wind">
								<a href="javascript:order('wd10df')" class="order">风速</a>
							</th>
							<th class="wind">
								风向
							</th>
							<th class="wind">
								<a href="javascript:order('wd10maxdf')" class="order">风速</a>
							</th>
							<th class="wind">
								出现时间
							</th>
							<th class="wind">
								风向
							</th>
							<th class="wind">
								<a href="javascript:order('wd3smaxdf')" class="order">风速</a>
							</th>
							<th class="wind">
								出现时间
							</th>
							<th class="wind">
								风向
							</th>
							<th class="wind">
								<a href="javascript:order('wf10daymax')" class="order">风速</a>
							</th>
							<th class="wind">
								出现时间
							</th>
							<th class="wind">
								风向
							</th>
							<th class="wind">
								<a href="javascript:order('wf3daymax')" class="order">风速</a>
							</th>
							<th class="wind">
								出现时间
							</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td colspan="19" align="center">
								<c:if test="${empty zdzList}">暂无数据</c:if>
							</td>
						</tr>
						<c:forEach items="${zdzList}" var="report">
							<tr>
								<td class="a-center ">
									<c:if test="${report.zdzType == '镇区'}">
										<div style="color: blue">${report.id}</div>
									</c:if>
									<c:if test="${report.zdzType != '镇区'}">
										${report.id}
									</c:if>
									<%--							${report.rain }${report.wind }--%>
								</td>
								<td class="a-center ">
									${report.zdzName }
								</td>
								<td class="a-center  rain">
									${report.hourrfString }
								</td>
								<td class="a-center  rain">
									${report.threehourrfString }
								</td>
								<td class="a-center  rain">
									${report.twentyfourhourrfString }
								</td>
								<td class="a-center wind">
									${report.wd10dd }
								</td>
								<td class="a-center wind">
									${report.wd10dfString }
								</td>
								<td class="a-center wind">
									${report.wd10maxdd }
								</td>
								<td class="a-center wind">
									${report.wd10maxdfString }
								</td>
								<td class="a-center wind">
									<fmt:formatDate value="${report.wd10maxtime}"
										pattern="yyyy-MM-dd HH:mm" />
								</td>
								<td class="a-center wind">
									${report.wd3smaxdd}
								</td>
								<td class="a-center wind">
									${report.wd3smaxdfString }
								</td>
								<td class="a-center wind">
									<fmt:formatDate value="${report.wd3smaxtime}"
										pattern="yyyy-MM-dd HH:mm" />
								</td>
								<td class="a-center wind">
									${report.wd10daymax }
								</td>
								<td class="a-center wind">
									${report.wf10daymaxString }
								</td>
								<td class="a-center wind">
									<fmt:formatDate value="${report.wd10daymaxtime}"
										pattern="yyyy-MM-dd HH:mm" />
								</td>
								<td class="a-center wind">
									${report.wd3daymax }
								</td>
								<td class="a-center wind">
									${report.wf3daymaxString }
								</td>
								<td class="a-center wind">
									<fmt:formatDate value="${report.wd3daymaxtime}"
										pattern="yyyy-MM-dd HH:mm" />
								</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<div id="temp" style="height: 30px; padding-left: 500px;"></div>
				<div>
					备注：</br>
					1.<font style="color: blue">蓝</font>色字体表示镇区自动站。</br>
					2.24小时雨量表示从昨天${hour}点到今天当前时间的累积雨量。
				</div>
				<%--<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
					width="900" height="1076" id="disasterWarning">
					<param name="movie"
						value="<%=basePath%>/login/flex-bin/disasterWarning.swf" />
					<param name="quality" value="high" />
					<param name="bgcolor" value="#ffffff" />
					<param name="allowScriptAccess" value="sameDomain" />
					<param name="allowFullScreen" value="true" />
					<!--[if !IE]>-->
					<object type="application/x-shockwave-flash"
						data="<%=basePath%>/login/flex-bin/disasterWarning.swf"
						width="900" height="1076">
						<param name="quality" value="high" />
						<param name="bgcolor" value="#ffffff" />
						<param name="allowScriptAccess" value="sameDomain" />
						<param name="allowFullScreen" value="true" />
						<!--<![endif]-->
						<!--[if gte IE 6]>-->
						<p>
							Either scripts and active content are not permitted to run or
							Adobe Flash Player version50.0.0 or greater is not installed.
						</p>
						<!--<![endif]-->
						<a href="http://www.adobe.com/go/getflashplayer"> <img
								src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
								alt="Get Adobe Flash Player" /> </a>
						<!--[if !IE]>-->
					</object>
					<!--<![endif]-->
				</object>
			--%></div>
			<br />
		</div>
	</body>
</html>